﻿using GKQC.Common;
using GKQC.DbHelper.Dao;
using GKQC.DbHelper.DbModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace GKQC.DbHelper.Services
{
    /// <summary>
    /// 系统参数Service
    /// </summary>
    public class SysParamService
    {
        public static string GetSysParamValue(AllDbContext dbContext,string code)
        {
            string value = string.Empty;

            try
            {
                AllDbContext dbContext1 = new AllDbContext(); 
                var param = dbContext1.QcDb.Queryable<SysParamsModel>().Where(t => t.Code == code);
                if (param != null && param.Count() >0)
                {
                    value = param.First().Value;
                }
            }
            catch(Exception ex)
            {
                Logger.LogError(ex);
            }


            return value;
        }
    }
}
